
<!DOCTYPE html>
<html>
<head>[#include "../manage/common/head.html" /]
</head>

<body class="gray-bg">
	<div class="wrapper wrapper-content" style="height: 100%">
		<div class="row" style="height: 100%">
			<div class="col-sm-12" style="height: 100%">
				<div class="ibox float-e-margins" style="height: 100%">
					<div class="ibox-title">
						<h5>密码修改</h5>
					</div>
					<div class="ibox-content" style="height: 100%">
						<div role="form" class="form-inline" style="height: 100%">
                            <div class="form-group col-sm-3">
								<label class="col-sm-3 control-label">用户名</label>
								<div class="col-sm-9">
									<input type="text" class="form-control" id="userName">
								</div>
							</div>
							<div class="form-group col-sm-3">
								<label class="col-sm-3 control-label">新密码</label>
								<div class="col-sm-9">
									<input type="text" class="form-control" id="password" placeholder="请输入新密码！">
								</div>
							</div>
							<div class="form-group col-md-12 text-center">
								<button type="button" class="btn-lg btn-primary" id="save">保存</button>
							</div>
						</div>
					</div>
					<input type="hidden" id="managerId">
				</div>
			</div>
		</div>
	</div>
	[#include "../manage/common/js.html" /]
	<script>
		$.post("${base}/manage/user/getMangerInfo/1",function(r){
			$("#userName").val(r.mangerInfoVo.userName);
			$("#managerId").val(r.mangerInfoVo.id);
		},'json');
		
		$("#save").click(function(){
			var userName = $("#userName").val().trim();
			if (userName == "") {
				swal("警告", "请填写用户名！", "warning");
				return;
			}
			var password = $("#password").val().trim();
			if (password == "") {
				swal("警告", "请填写新密码！", "warning");
				return;
			}
			var id = $("#managerId").val();
			$.post("${base}/manage/user/modifyUserPassword", {
				id : id,
				userName : userName,
				password : password
			}, function(r) {
				if (r.code == 0) {
					swal("成功", "保存完成！", "success");
				} else {
					swal("错误", r.msg, "error");
				}
			}, 'json')
		});
	</script>
</body>
</html>
